package com.ellis.ellisSpringboot02.utils;

import com.ellis.ellisSpringboot02.entity.vo.ResultVo;

/**
 * 处理结果的工具类
 */
public class ResultUtils {
    //成功操作且没有任何附加备注信息
    public static ResultVo success(){
        ResultVo resultVo = new ResultVo();
        resultVo.setResultNum(1);
        return resultVo;
    }

    //成功操作并且有附加备注信息
    public static ResultVo success(String message){
        ResultVo resultVo = new ResultVo();
        resultVo.setResultNum(1);
        resultVo.setResultMessage(message);
        return resultVo;
    }

    //失败操作且没有任何附加备注信息
    public static ResultVo failed(){
        ResultVo resultVo = new ResultVo();
        resultVo.setResultNum(2);
        return resultVo;
    }

    //失败操作并且有附加备注信息
    public static ResultVo failed(String message){
        ResultVo resultVo = new ResultVo();
        resultVo.setResultNum(2);
        resultVo.setResultMessage(message);
        return resultVo;
    }
}
